package com.fourforfo.fourmall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fourforfo.common.utils.PageUtils;
import com.fourforfo.fourmall.product.entity.SpuInfoDescEntity;
import com.fourforfo.fourmall.product.entity.SpuInfoEntity;
import com.fourforfo.fourmall.product.vo.SpuSaveVO;

import java.util.List;
import java.util.Map;

/**
 * spu信息
 *
 * @author fourforfo
 * @email fourforfo@gmail.com
 * @date 2022-06-15 21:04:46
 */
public interface SpuInfoService extends IService<SpuInfoEntity> {


    PageUtils queryPage(Map<String, Object> params);

    /**
     * 保存发布商品业务所提交的所有相关信息
     * @param spuSaveVO
     */
    void saveSpuInfo(SpuSaveVO spuSaveVO);

    /**
     * 保存spu基本信息 pms_spu_info
     * @param spuInfoEntity
     */
    void saveBaseSpuInfo(SpuInfoEntity spuInfoEntity);

    /**
     *  1. 商品上架即更新商品状态
     *  2. 将该商品信息加入到ElasticSearch
     * @param spuId pms_spu_info表的id
     */
    void upProduct(Long spuId);

    /**
     * 根据skuIds获取所有spuInfo信息，将spuInfo信息和对应的skuId保存到map中
     * @param skuIds
     * @return
     */
    Map<Long, SpuInfoEntity> listSpuInfoBySkuIds(List<Long> skuIds);
}

